﻿using Nancy;
using Nancy.Bootstrapper;
using Nancy.TinyIoc;

namespace distpm
{
    public class CustomBootstrapper: DefaultNancyBootstrapper
    {
        protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines)
        {
            pipelines.AfterRequest += (ctx) =>
            {
                ctx.Response.Headers.Add("Access-Control-Allow-Origin","*");
                ctx.Response.Headers.Add("Access-Control-Allow-Headers","authorization, content-type");
                ctx.Response.Headers.Add("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS");
                ctx.Response.ContentType = "text/html;charset=utf8";


            };
            base.ApplicationStartup(container, pipelines);
        }

       
    }
}